package com.chinatelecom.otms.circuitcheck.dao;

import com.chinatelecom.otms.circuitcheck.entity.*;
import com.chinatelecom.otms.circuitcheck.mapper.CheckCircuitMapper;
import com.chinatelecom.otms.circuitcheck.util.Common;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class CheckCircuitDao {

    @Autowired
    private CheckCircuitMapper checkCircuitMapper;

    @Autowired
    private JdbcTemplate jdbcTemplate;

    private int count = 0;


    public void truncateTable() {
        checkCircuitMapper.truncateTable(Common.TABLE_NAME);
    }

    public List<CheckCircuit> executeConnectByRootSql(List<String> list){
        return checkCircuitMapper.executeConnectByRootSql(list);
    }

    public Integer insertCheckCircuitList(List<CheckCircuit> list){
        return checkCircuitMapper.insertCheckCircuitListByList(list, Common.TABLE_NAME);
    }

    public List<CheckCarrierAndSncRouteResult> checkCarrierAndSncRoute(String snc_id) {
        return checkCircuitMapper.checkCarrierAndSncRoute(snc_id);
    }

    public List<FDFRCarrierResult> checkFDFRinCarrier(String snc_id) {
        return checkCircuitMapper.checkFDFRinCarrier(snc_id);
    }

    public List<MFDFRPortResult> checkMFDFRPort(String snc_id, boolean isCheckPTP) {
        if(isCheckPTP){
            return checkCircuitMapper.checkMFDFRPort(snc_id);
        }else{
            return checkCircuitMapper.checkMFDFRPortPTP(snc_id);
        }
    }

    public List<CheckFDFRRouteInSncAndMFDFRResult> checkFDFRRouteInSncAndMFDFR(String snc_id) {
        return checkCircuitMapper.checkFDFRRouteInSncAndMFDFR(snc_id);
    }

    public List<CheckL2LinkRouteResult> checkL2LinkRoute(String snc_id) {
        return checkCircuitMapper.checkL2LinkRoute(snc_id);
    }

    public List<L2LinkTempResult> getAZPortByobjId(String snc_id) {
        return checkCircuitMapper.getAZPortByobjId(snc_id);
    }


    public List<L2LinkTempResult> getAZPortBySncId(String snc_id) {
        return checkCircuitMapper.getAZPortBySncId(snc_id);
    }

    public List<CheckPortStateVlanResult> checkPortStateVlan(String snc_id) {
        return checkCircuitMapper.checkPortStateVlan(snc_id);
    }

    public List<CheckBindingRelResult> checkBindingRel(String snc_id) {
        return checkCircuitMapper.checkBindingRel(snc_id);
    }

    public List<CheckFTPBindingRelResult> checkFTPBindingRel(String snc_id) {
        return checkCircuitMapper.checkFTPBindingRel(snc_id);
    }

    public List<User> selectUser() {
        return checkCircuitMapper.selectUser();
    }
}
